package com.shelpe.services.sinbad.entity.jpa;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
import com.shelpe.services.sinbad.entity.jpa.ContainerSetting.ContainerSettingPK;

import lombok.Data;

@Entity(name = "container_settings")
@IdClass(ContainerSettingPK.class)
@Data
public class ContainerSetting {
	@Id
	@Column(name = "user_id")
	private long userID;
	@Id
	private String settingKey;
	@Id
	@Column(name = "container_id")
	private long containerID;
	@Id
	private String containerType;

	private String settingValues;

	@JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	@JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
	private Date lastModifiedTime;

	@Data
	public static class ContainerSettingPK implements Serializable {
		private static final long serialVersionUID = 1L;
		@Column(name = "user_id")
		private long userID;
		private String settingKey;
		@Column(name = "container_id")
		private long containerID;
		private String containerType;
	}
}
